package com.bawei.wyg.mycommerce.splash.model;

import com.bawei.wyg.mvvmcommon.mvvm.model.BaseModel;
import com.bawei.wyg.mycommerce.splash.data.TokenEntity;
import com.bawei.wyg.mycommerce.utils.Api;
import com.bawei.wyg.networkmodel.ChangeFunction;
import com.bawei.wyg.networkmodel.HttpFactory;
import com.bawei.wyg.networkmodel.HttpType;
import com.bawei.wyg.networkmodel.entity.BaseEntity;

import java.util.Map;

import io.reactivex.Observable;

public class SplashModel extends BaseModel {
    public Observable<BaseEntity> requestToken(Map<String,Object> map){
        return HttpFactory.getInstance().factory(HttpType.SIGNTYPE)
                .getRetrofit().create(Api.class)
                .requestToken(createBody(map))
                .map(new ChangeFunction<TokenEntity>());
    }
}
